package com.baibei.ebec.quotation.converter;

import android.text.TextUtils;

import com.baibei.ebec.quotation.AppQuotationFilter;
import com.baibei.model.MarketStatusInfo;
import com.baibei.quotation.IActionDispatch;
import com.baibei.quotation.QuotationFilter;
import com.google.gson.Gson;

/**
 * 开休市推送
 * Created by shenminjie on 2017/10/19.
 * mail:shenminjie@100bei.com
 */

public class MarkeStatusConverter implements IActionDispatch<MarketStatusInfo> {

    private final Gson mGson = new Gson();

    @Override
    public MarketStatusInfo convert(String s) throws Exception {
        return mGson.fromJson(s, MarketStatusInfo.class);
    }

    @Override
    public boolean handleAction(String action) {
        return TextUtils.equals(action, AppQuotationFilter.ACTION_MARKET_STATUS) ;
    }

    @Override
    public boolean dispatch(QuotationFilter quotationFilter, Object o) {
        return true;
    }

    @Override
    public boolean canCache() {
        return false;
    }
}
